﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Quartz;
using System.Xml;
using System.IO;

namespace QuartzStudyWeb
{
    public class XMLOp : IJob
    {
        #region IJob 成员

        public void Execute(JobExecutionContext context)
        {
            string xmlPath;
            xmlPath = AppDomain.CurrentDomain.BaseDirectory + "xmldocument.xml";
            //xmlPath = HttpContext.Current.Server.MapPath("~/xmldocument.xml");
            XmlWriter writer = XmlWriter.Create(xmlPath);
            writer.WriteElementString("time",DateTime.Now.ToString());
            //writer.WriteStartElement("time");
            //writer.WriteString(DateTime.Now.ToString());
            //writer.WriteEndElement();
            writer.Flush();
            writer.Close();
        }

        #endregion
    }
}
